const ordermodle = require('../modle/order')
const productmodle = require('../modle/products')
module.exports = {
    async addOrderserves(data) {
        return await ordermodle.create(data)
    },
    async getorderservice(userid) {
        return await ordermodle.findAll({
            where: {
                userid
            },
            order: [
                ['createdAt', 'DESC']
            ]
        })
    },
    async getproductdata(id) {
        return await productmodle.findOne({
            where: {
                id
            }
        })
    },
    async setorderservice(orderid, status) {
        return await ordermodle.update({ status }, {
            where: {
                orderid
            }
        })
    }
}